﻿using System;
using BusinessLayer.VDataEntities;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;

namespace CustomerServiceCenter.Helper
{
    public static  class UserHelper
    {
        public static VPromoter GetCurrentPromoterUser()
        {
            VPromoter CurrentUser = new VPromoter();

            CurrentUser = System.Web.HttpContext.Current.Session["PromoterInfo"] as VPromoter;


            //CurrentUser = System.Web.HttpContext.Current.Session["PromoterInfo"] as UserWXModel;
            return CurrentUser;
        }

        //public static string GetWeixinUserIdFromCookie()
        //{
        //    HttpCookie aCookie = HttpContext.Current.Request.Cookies[FormsAuthentication.FormsCookieName + "userid"];
        //    string userid = "";
        //    if (aCookie != null && !string.IsNullOrEmpty(aCookie.Value))
        //    {
        //        try
        //        {
        //            FormsAuthenticationTicket ticket = FormsAuthentication.Decrypt(aCookie.Value);
        //            userid = ticket.UserData;
        //        }
        //        catch
        //        {

        //        }
        //    }
        //    return userid;
        //}
    }
}